package Service.imp;

import Service.UserService;
import dao.UserDao;
import entity.User;

import java.util.List;

public class UserServiceImp implements UserService {
    UserDao userDao=new UserDao();
    @Override
    public User login(String username, String password) {
        User user=userDao.login(username,password);
        return user;
    }

    @Override
    public int register(String username, String password, int permission) {
        return userDao.register(username,password,permission);
    }

    @Override
    public User list(String username) {
        User user=userDao.list(username);
        return user;
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public int updatePassword(int userId, String newPassword) {
        return userDao.updatePassword(userId, newPassword);
    }
}
